from . import views
from django.urls import  path

urlpatterns = [
    # http://usernames/itcast/count/
    path('usernames/<username:username>/count/', views.UsernameCountView.as_view()),

    # http://mobiles/1347897962/count/
    path('mobiles/<mobile:mobile>/count/', views.UserMobileCountView.as_view()),

    #/register/用户注册
    path('register/', views.UserRegisterView.as_view()),

    #/login/用户登录
    path('login/', views.LoginView.as_view()),

    #logout/退出登录
    path('logout/', views.LogoutView.as_view()),

    #info/用户中心
    path('info/', views.UserInfoView.as_view()),

    #emails/添加邮箱
    path('emails/', views.EmailView.as_view()),

    #验证激活邮箱 /emails/verification/
    path('emails/verification/', views.EmailActiveView.as_view()),

    #新增地址 POST/addresses/create/
    path('addresses/create/', views.CreateAddressView.as_view()),

    #显示地址 GET/addresses/
    path('addresses/', views.AddressView.as_view()),

    # 修改和删除地址/addresses/(?P<address_id>\d+)/
    path('addresses/<int:address_id>/', views.UpdateDestroyAddressView.as_view()),

    #设置默认地址 PUT请求地址/addresses/(?P<address_id>\d+)/default/
    path('addresses/<int:address_id>/default/', views.DefaultAddressView.as_view()),

    #设置地址标题 PUT请求地址/addresses/(?P<address_id>\d+)/title/
    path('addresses/<int:address_id>/title/', views.UpdateTitleAddressView.as_view()),

    #PUT请求地址	/password/
    path('password/', views.ChangePasswordView.as_view()),

    #请求地址/browse_histories/
    path('browse_histories/', views.UserBrowseHistory.as_view()),

]